package demos;

import java.util.Arrays;
import java.util.List;

public class RegexDemo {
    public static void main(String[] args) {


                /*000019,product_view ,
                000019,product_addCart ,
                000019,product_pay,
                000019,product_view,
                000019,product_search,
                000019,product_addCart,
                000019,product_pay,*/
       ///查出来的用户历史数据行为
        List<String> events = Arrays.asList("product_search","product_view", "product_addCart",
                "product_pay", "product_search","product_view","product_view",
                "product_addCart","product_addCart","product_pay","product_pay"
                ,"product_search","product_search");

        //预设的要匹配的事件
        List<String> targetEvents = Arrays.asList("product_search", "product_view", "product_addCart","product_pay"
                );
        StringBuffer sb = new StringBuffer();
        for (String event : events) {

            sb.append(targetEvents.indexOf(event)+1);
        }
        System.out.println(sb.toString());


    }
}
